package com.fit.pages.user;

import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.fit.annotations.AdminAccess;
import com.fit.annotations.UserAccess;
import com.fit.dao.user.UserDAO;
import com.fit.entities.User;
import com.fit.pages.Confirmation;

@AdminAccess
public class Details {

	@Property
	@Persist
	private User user;
	
	@Inject
	private UserDAO userDAO;
	
	public boolean isCompanyNotNull(){
		if(user.getCompany()!=null){
			return true;
		} else {
			return false;
		}
	}
	
	Object onActivate(String username) {
		user = userDAO.findByUsername(username);
		return null;

	}

}
